<template>
    <div></div>
</template>

<script>
    export default {
        name: "flow_order",
        data: function() {
            return {};
        },
        created: function() {
            var that = this;
            var tradeNo = this.$route.params.tradeNo;
            this.common.post(this.api.flow_order, {
                tradeNo: tradeNo,
            }, function(data) {
                var res = data.resultMap;
                var status = parseInt(res.tradeStatus);
                var redirect = String.Format("/apply/confirm_order/{0}/{1}", res.kid, tradeNo);
                if (status == 3) {
                    redirect = "/apply/refund_success/" + tradeNo;
                } else if (status == 2) {
                    redirect = "/apply/apply_success/" + tradeNo;
                } else if (status == 0) {
                    that.common.toPage("/apply/zhifubao/" + tradeNo);
                    return;
                }
                that.common.toPage(redirect);
            });
        }

    }
</script>

<style>
</style>
